package bandi.osgi.dal.dao.beans;

import java.io.Serializable;


public class Device implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5569294438942502849L;

	private long device_id;;
	private User user;
	private DeviceType device_type;
	private String carrier;
	private String phone_number;
	private String lat;
	private String lon;
	private String time;

	public Device(String carrier, long device_id, DeviceType device_type,
			String phone_number, User user,String lat,String lon,String time) {
		super();
		this.carrier = carrier;
		this.device_id = device_id;
		this.device_type = device_type;
		this.phone_number = phone_number;
		this.user = user;
		this.lat=lat;
		this.lon=lon;
		this.time=time;
	}

	public Device() {
		super();
	}

	public long getDevice_id() {
		return device_id;
	}

	public void setDevice_id(long device_id) {
		this.device_id = device_id;
	}

	public User getUser() {
		return user;
	}
	

	public void setUser(User user) {
		this.user = user;
	}

	public DeviceType getDevice_type() {
		return device_type;
	}

	public void setDevice_type(DeviceType device_type) {
		this.device_type = device_type;
	}

	public String getCarrier() {
		return carrier;
	}

	public void setCarrier(String carrier) {
		this.carrier = carrier;
	}

	public String getPhone_number() {
		return phone_number;
	}

	public void setPhone_number(String phone_number) {
		this.phone_number = phone_number;
	}
	
	public String getLat() {
		return lat;
	}

	public void setLat(String lat) {
		this.lat = lat;
	}
	
	public String getLon() {
		return lon;
	}

	public void setLon(String lon) {
		this.lon = lon;
	}
	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}
	

	
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((carrier == null) ? 0 : carrier.hashCode());
		result = prime * result + (int) (device_id ^ (device_id >>> 32));
		result = prime * result
				+ ((device_type == null) ? 0 : device_type.hashCode());
		result = prime * result
				+ ((phone_number == null) ? 0 : phone_number.hashCode());
		result = prime * result + ((user == null) ? 0 : user.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Device other = (Device) obj;
		if (carrier == null) {
			if (other.carrier != null)
				return false;
		} else if (!carrier.equals(other.carrier))
			return false;
		if (device_id != other.device_id)
			return false;
		if (device_type == null) {
			if (other.device_type != null)
				return false;
		} else if (!device_type.equals(other.device_type))
			return false;
		if (phone_number == null) {
			if (other.phone_number != null)
				return false;
		} else if (!phone_number.equals(other.phone_number))
			return false;
		if (user == null) {
			if (other.user != null)
				return false;
		} else if (!user.equals(other.user))
			return false;
		return true;
	}

}
